<template>
	<view class="wrap">
		<u-navbar :title="$t('jyxq')" title-width="340" :border-bottom="false" back-icon-color="#fff" title-color="#fff" :background="{ backgroundColor: '#0030A8' }"></u-navbar>
		<view class="tom-container">
			<view class="list">
				<view class="cell">
					<text class="cell-label">{{$t('clid')}}</text>
					<text class="cell-value" @tap="copy(pageData.tacticsId)">
						{{pageData.tacticsId}}
						<u-icon name="fuzhi" custom-prefix="custom-icon" size="28" style="margin-left: 12rpx;"></u-icon>
					</text>
				</view>
				<view class="cell">
					<text class="cell-label">{{$t('ddh')}}</text>
					<text class="cell-value">{{pageData.orderId}}</text>
				</view>
				<view class="cell">
					<text class="cell-label">{{$t('leixing')}}</text>
					<text class="cell-value">{{pageData.txType}}</text>
				</view>
				<view class="cell">
					<text class="cell-label">{{$t('cjsl')}} / {{$t('shuliang')}}</text>
					<text class="cell-value">{{pageData.executedqty}} {{pageData.exchangeCoinBefore}}</text>
				</view>
				<view class="cell">
					<text class="cell-label">{{$t('cjjj')}} / {{$t('jiage')}}</text>
					<text class="cell-value">{{pageData.avgprice}}  {{pageData.exchangeCoinAfter}}</text>
				</view>
				<view class="cell">
					<text class="cell-label">{{$t('jyssxf')}}</text>
					<text class="cell-value">{{pageData.commission}}  {{pageData.exchangeCoinAfter}}</text>
				</view>
				<view class="cell">
					<text class="cell-label">{{$t('cjl')}}</text>
					<text class="cell-value">{{pageData.executedqty}}</text>
				</view>
				<view class="cell">
					<text class="cell-label">{{$t('ysxyk')}}</text>
					<text class="cell-value">{{pageData.realizedpnl}}  {{pageData.exchangeCoinAfter}}</text>
				</view>
				<view class="cell">
					<text class="cell-label">{{$t('xdsj')}}</text>
					<text class="cell-value">{{pageData.createDate || '--'}}</text>
				</view>
				<view class="cell">
					<text class="cell-label">{{$t('cjsj')}}</text>
					<text class="cell-value">{{pageData.transactionTime || '--'}}</text>
				</view>
				<view class="cell">
					<text class="cell-label">{{$t('jylx')}}</text>
					<text class="cell-value">{{pageData.txMode}}</text>
				</view>
				<view class="cell">
					<text class="cell-label">{{$t('jys')}}</text>
					<text class="cell-value">{{pageData.exchangeName}}</text>
				</view>
				<view class="cell">
					<text class="cell-label">{{$t('jyd')}}</text>
					<text class="cell-value">{{pageData.exchangeCoin}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			pageData:{},
			id:'',
		};
	},
	onShow() {
		this.indexData();
	},
	onLoad(options) {
		var open =JSON.parse(options.item);
		this.id=open.id;
		console.log(this.id)
	},
	methods: {
		indexData(){
			this.$api.consoleApi.getContractTransactionInfo({
				id:this.id,
			}).then(res => {
				this.pageData = res.data;
			})
		},
		copy(val){
			this.$utils.copy(val);
		},
	}
};
</script>

<style lang="scss" scoped>
.list {
	flex: 1;
	border-radius: 20rpx;
	overflow: auto;
	background-color: #fff;
	margin: $nr-padd;
	.cell{
		display: flex;
		align-items: center;
		justify-content: space-between;
		border: 2rpx solid $page-bg;
		padding: 30rpx $nr-padd;
		.cell-label{
			color: $tom-text-color;
			font-size: 28rpx;
			font-weight: bold;
			width: 210rpx;
		}
		.cell-value{
			color: $tom-text-sub-color;
			font-size: 28rpx;
		}
	}
}
</style>
